home *** CD-ROM | disk | FTP | other *** search
- DEBUG87 PATCH FOR IBM DEBUG VER 2.X
-
- By Bill Janes
-
- This is a patch to the IBM Debug 2.0 or 2.1 utility that helps in
- the debugging of 8087 assembly language programs by adding a
- command to debug that causes the contents of 8087 stack registers
- to be displayed on the screen. The contents of the 8087 stack
- are displayed using the Intel floating point to ASCII conversion
- routine that is in their Application Note AP-113 (ref 1).
- Integer numbers are displayed as such, and nonintegral numbers
- are displayed in exponential format. A resister that is empty,
- NAN, indefinite, or infinity is so labeled. The flags in the
- control word and the status word are also shown, along with the
- next instruction to be executed (as with the debug R command).
- The abbreviations for these flags is that used in the Intel
- Numerics Supplement. For more details, refer to in references 2
- and 3.
-
- ADDING THE PATCH
-
- The necessary files to carry out the patch are PATCH4.BIN,
- DEBUG7.PAT, DEBUG.COM. The first two are in the library, and you
- must supply debug.com since it is not in the public domain.
- First make certain that you have the IBM version 2.0 or 2.1 of
- debug that comes with like versions of DOS. Debug is the same in
- both versions, but the debug supplied with DOS 3.0 is different
- and can't be used. The debug supplied with the Microsoft Macro
- assemabler 1.27 also appears to be different, and should not be
- used. The original version of debug, without any patches should
- be used. Adding the patch to DEBUG.COM is very easy, but
- requires that you are running under DOS 2.0 or above. Make sure
- that the following files are all in the current directory:
- debug.com (your original version), patch.bin (which contains the
- code for the patch) and debug7.pat (which serves an an input file
- for debug in carrying out the patch). Then type at the command
- line: DEBUG < DEBUG7.PAT. This activates debug which uses the
- redirection feature of DOS 2.0 and performs the patch according
- to the instructions in debug7.pat and writes the patched program
- to disk as DEBUG87.COM. This patch also corrects a bug in the
- original debug program that occasionally locks up the program;
- this second patch was suggested by Stephen Baumgartner (ref. 3).
- I have used it for a year with no problems. For details about
- the lockup problem and its correction see references 4 and 5.
-
- USING THE DEBUG87
-
- To use the patched program, simply type P from the debug command
- line, for numeric Processr. The choice of letters is quite
- limited; most of the 26 letters of the alphabet are already in
- use (Debug 3.0 uses the P command for another purpose). The
- 8087 stack registers are displayed along with the control flags
- and status flags. The abbreviations for the flags is that in the
- Intel literature and is in references 2 and 3, which also explain
- their significance.
-
- TESTING THE PATCH
-
- The patch may be tested and its use illustrated by using DEBUG87
- with the short program TEST.COM which is included in the library
- along with its assembly listing. At the dos command level type
- in DEBUG87 TEST.COM. Debug87 will load the test program and
- display the debug prompt in the usual fashion. Then type in G
- 13E and then P. Your output should be similar to what is shown
- below. If not, something must be wrong; perhaps your version of
- Debug is different from mine. If everythink seems OK, further
- testing may by done by single stepping through the program and
- displaying the 8087 status ofter each instruction. The FXAM
- instructions are included to check the condition flags.
-
-
- debug87 test.com
- -G 13E
- X=0000 BX=0000 CX=0055 DX=0000 SP=FFFE BP=0000 SI=0000 DI=0000
- DS=1065 ES=1065 SS=1065 CS=1065 IP=013E NV UP DI PL NZ NA PO NC
- 1065:013E 9B WAIT
- -P
- T(0) +0 ST(1) -3.14159265358979
- ST(2) +1.23456700000000E+103 ST(3) +1234
- ST(4) +INFINITY ST(5) INDEFINITE
- ST(6) +NAN ST(7) EMPTY
- CONTROL IC=0 RC=00 PC=11 IEM=1 PM=1 UM=1 0M=1 ZM=1 DM=1 IM=1
- STATUS B=0 C3=0 ST=1 C2=0 C1=0 C0=1 IR=0 PE=0 UE=0 OE=0 ZE=1 DE=0 IE=1
- 1065:013E 9B WAIT
- -Q
-
- References:
-
- 1. Getting Started with the Numeric Data Processor, AP-113,
- Intel Corporation, 1981.
-
- 2. IAPX 86/20, 88/20 Numerics Supplement, in iAPX 86, 88 User's
- Manual, Intel Corp 1981.
-
- 3. Startz, Richard: 8087 Applications and Programming for the IBM PC.
- Brady Co., 1983
-
- 4. Baumgartner, Stephen: in User to User column, PC Magaine,
- 2:653-654, 1983 (December 83).
-
- 5. Smith, Bob and Puckett, Tom: Time on your Hands. A patch
- to Debug.com. PC Tech Journal 1:146-161, 1984 (May).
-
- Please send any comments or suggestions to me via Compuserve.
- Bill Janes 74166,2572
-